import redis
import time
from celery import Celery

backend = 'redis://:tansi201407@192.168.8.10:6379/2'    # backend存储结果
broker = 'redis://:tansi201407@192.168.8.10:6379/2'     # broker
app = Celery('tasks',                                   # 名字
             backend=backend,broker=broker)


# 创建任务函数

@app.task #普通函数装饰为 celery task
def add(x,y):
    return x+y





